#include <tuple>

using namespace std;

template <typename T>
class LoopQueue
{
public:
    LoopQueue(int capacity);
    virtual ~LoopQueue(){};
    void Clear();
    bool IsEmpty() const;
    bool IsFull() const;
    int Len() const;
    bool EnQueue(T element);
    tuple<bool, T> DeQueue();

private:
    int head, tail, cap;
    T **elements;
};
